package com.wn.main.ui.system.viewmodel

import com.wn.common.model.SystemList
import com.wn.main.ui.system.repository.SystemRepository
import com.wn.network.viewmodel.BaseViewModel
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.flow.StateFlow
import javax.inject.Inject

/**
 * @Author: wn
 * @Date: 2025/4/28 16:18
 * @Description: 体系 ViewModel
 */
@HiltViewModel
class SystemViewModel @Inject constructor(private val repository: SystemRepository) :
  BaseViewModel() {
  /**
   * 获取体系列表
   * @return StateFlow<MutableList<SystemList>?>
   */
  fun getSystemList(): StateFlow<MutableList<SystemList>?> =
    callBaseRequest({ scope, errorCall, showLoading ->
      repository.getSystemList(
        scope,
        errorCall,
        showLoading
      )
    }, true)
}